﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NaverMapMultiMarker.aspx.cs" Inherits="Updms.Common.Inc.NaverMapMultiMarker" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [네이버 맵] ▒▒▒▒▒▒▒▒▒▒</title>
<style type="text/css">
body { margin:0; }
div.map_info_box { border:1px solid #9CAAC1; background-color:#BCC6D7; color:#333333; font-size:8pt; }
</style>
</head>
<body>
<script type="text/javascript" src="http://map.naver.com/js/naverMap.naver?ver=2.0&key=b38bbf1245f5060e7bc59399d0b52a3a"></script>
<div id="mapContainer" style="width:600px; height:600px;"></div>
<script type="text/javascript">
<!--
/*지도 개체 생성 */
var opts = {width:600, height:600, mapMode:0};	//mapMode 0:일반지도,1:겹침지도,2:위성지도
var mapObj = new NMap(document.getElementById('mapContainer'),opts);

/* 지도 모드 변경 버튼 생성 */
var mapBtns = new NMapBtns();
mapBtns.setAlign("right");
mapBtns.setValign("top");
mapObj.addControl(mapBtns);




//mapObj.setCenterAndZoom(new NLatLng(36.5852187,127.9399865),10);	//위도,경도 (한반도 가운데 좌표)

//포인트로
mapObj.setCenterAndZoom(new NPoint(300068, 543252), 5); //우리집 좌표기준


mapObj.zoomOut();
var zoom = new NZoomControl();

zoom.setAlign("right");
zoom.setValign("top");

mapObj.addControl(zoom);

var idx = new NIndexMap(); 
mapObj.addControl(idx); 
idx.hideIMap(); 

var saveBtn = new NSaveBtn();
mapObj.addControl(saveBtn);

mapObj.enableWheelZoom();


var iconUrl = '../Images/tick.gif';

//marker.setTargeturl("http://www.naver.com");  //마커 링크부분


var markers = "<%= MARKERS() %>";
var arrMarkers = markers.split('|');

if (arrMarkers.length > 0){
	for (var i=0; i<arrMarkers.length; i++){
		var arrXY = arrMarkers[i].split(',');	//123,345
		if (arrXY.length > 0){
			var xP = parseInt(arrXY[0]);
			var yP = parseInt(arrXY[1]);
			var contents = arrXY[2];

			var marker = new NMark(new NPoint(xP,yP),new NIcon(iconUrl,new NSize(19,25),new NSize(19,25)));
			mapObj.addOverlay(marker);

			//관련텍스트 추가
			var ak = new NInfoWindow();
			mapObj.addOverlay(ak);
			ak.setOpacity(0.7)

			var aw = "<div class='map_info_box'>" + contents + "</div>";
			ak.set(new NPoint(xP, yP), aw)
			ak.showWindow();
		}
	}
}


//창크기 변경시 지도크기도 변경
window.onresize = function (event) {
	var ww = document.documentElement.clientWidth;
	var wh = document.documentElement.clientHeight;

	document.getElementById("mapContainer").style.width = ww + "px";
	document.getElementById("mapContainer").style.height = wh + "px";
}


/*
//관련텍스트 추가
var ak = new NInfoWindow();
mapObj.addOverlay(ak);
ak.setOpacity(0.7)

var aw = "<table cellpadding=5 cellspacing=0><tr><td nowrap style='background-color: #FF2890;color:#FFFFFF;font-size: 14px' ><co>"+"test"+"</co></td></tr></table>";
ak.set(new NPoint(315315,544772),aw)
ak.showWindow();
*/

-->
</script>



</body>
</html>
